name: Sharpass [Linux]

on:
  push:
    branches: [ "main" ]

jobs:
  build:

    defaults:
      run:
        working-directory: ./src

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v4
    - name: Setup .NET
      uses: actions/setup-dotnet@v4
      with:
        dotnet-version: 8.0.x
    - name: Install prerequisites for NativeAOT build
      run: sudo apt-get install clang zlib1g-dev
    - name: Restore dependencies
      run: dotnet restore
    - name: Publish
      run: dotnet publish -c Release -r linux-x64
    - uses: actions/upload-artifact@v4
      with:
        name: Sharpass
        path: /home/runner/work/sharpass/sharpass/src/Sharpass/bin/Release/net8.0/linux-x64/publish/Sharpass
